/*
  The <globals.h> header file defines some global variables and constants
*/

#ifndef _GLOBALS_H
#define _GLOBALS_H

#include <types.h>


/*
  When the computer boots up, GRUB gets executed and then the control passes to the kernel that needs to set up a weird GDT selector to be able to run at 0x80000000. This parameter is used to adjust logical to physical addresses before enabling paging by means of adding an offset that causes an overflow.
 */

// RELOC_PATCH + physical = virtual
#define RELOC_PATCH 0x7FF00000

// Define some address space constants

#define KERNEL_START    0x80000000
#define CORE_START      0x90000000

/* Used for Fractal memory Manager (Page Directory at top of address space) */
#define PAGE_TAB_START      0xFFC00000  /* Top 4 MB start */
#define PAGE_DIR_START      0xFFFFF000  /* Top 4 KB start */


// Common variables


extern dword_t Kernel_Start,Kernel_DataEnd,Kernel_End;
//EXTERN dword_t Kernel_Start;
//EXTERN dword_t Kernel_DataEnd;
//EXTERN dword_t Kernel_End;


// Memory information
extern dword_t mem_lower,mem_upper,mem_tot;
extern byte_t mmap_valid;

extern volatile dword_t kernel_entering_count;

/* Function Prototypes */

extern void globalVars_Initialize(void);

#endif /* _GLOBALS_H */

